//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

using System;
using System.Workflow.ComponentModel;
using ER = Microsoft.Research.DataLayer;

namespace Microsoft.Research.ScientificWorkflow.TridentModel
{
    [Serializable()]
    public class ForActivityCompositeModel : CompositeActivityModel, IIterativeInterface
    {
        /// <summary>
        /// Constructor of Activity Model.
        /// </summary>
        /// <param name="erActivity">Activity for which the model has to be created.</param>
        public ForActivityCompositeModel(ER.ActivitySequence erActivitySequence, ModelFactory modelFactory)
            : base(erActivitySequence, modelFactory) { }

        /// <summary>
        /// Constructor of Activity Model.
        /// </summary>
        /// <param name="source">Activity metadata for the activity model.</param>
        public ForActivityCompositeModel(ActivityMetadata source, string uniqueCount)
            : base(source, uniqueCount) { }

        /// <summary>
        /// Create the activity model for the Activity object.
        /// </summary>
        /// <param name="activity">
        /// The ComponentModel.Activity object.
        /// </param>
        public ForActivityCompositeModel(Activity activity, ModelFactory modelFactory)
            : base(activity, modelFactory) { }

        /// <summary>
        /// Create the activity model for the Activity object.
        /// </summary>
        /// <param name="activity">
        /// The ComponentModel.Activity object.
        /// </param>
        public ForActivityCompositeModel(Activity activity, BaseCompositeModel parentModel, ModelFactory modelFactory)
            : base(activity, parentModel, modelFactory) { }

        /// <summary>
        ///  Constructor of Activity Model.
        /// </summary>
        /// <param name="erActivitySequence">Activity for which the model has to be created.</param>
        /// <param name="parentModel">Parent model of teh Activity Sequence.</param>
        public ForActivityCompositeModel(ER.ActivitySequence erActivitySequence, BaseCompositeModel parentModel, ModelFactory modelFactory)
            : base(erActivitySequence, parentModel, modelFactory) { }

        /// <summary>
        /// Initializes a new instance of the <see cref="ForActivityCompositeModel"/> class.
        /// </summary>
        /// <param name="updatedActivity">The updated activity.</param>
        /// <param name="parentModel">The parent model.</param>
        /// <param name="uniqueCount">The unique count.</param>
        public ForActivityCompositeModel(ER.Activity updatedActivity, BaseCompositeModel parentModel, string uniqueCount)
            : base(updatedActivity, parentModel, uniqueCount) { }

        /// <summary>
        /// Gets true if the concrete implementation is a For model.
        /// </summary>
        public override bool IsForActivityModel
        {
            get
            {
                return true;
            }
        }

        public override void Accept(TridentBaseVisitor visitor)
        {
            visitor.VisitForActivityModel(this);
        }

        #region IterativeInterface Members

        public int IterativeValue { get; set; }

        #endregion
    }
}